<?php
class PasswordForm extends AppModel {
	var $name = 'PasswordForm';
	var $useTable = false;

	var $validate = array(
		'password' => array(
			'alphaNumeric' => array(
				'rule' => 'alphaNumeric',
				'required' => true,
				'allowEmpty' => false,
				'message' => Messages::password_must_be_alphabet_or_numeric
			),
			'minLength' => array(
				'rule' => array('minLength', 6),
				'message' => Messages::password_length_must_be_longer_than_6_characters
			)
		),
		'repeat_password'=> array(
			'alphaNumeric' => array(
				'rule' => 'alphaNumeric',
				'required' => true,
				'allowEmpty' => false,
				'message' => Messages::password_repeat_must_be_alphabet_or_numeric
			),
			'minLength' => array(
				'rule' => array('minLength', 6),
				'message' => Messages::password_length_must_be_longer_than_6_characters
			),
			'comparision' => array(
				'rule' => array('compareField', 'password'),
				'message' => Messages::password_repeat_must_be_same_with_password
			)
		),
	);
}